﻿using Gridify.WebAPI.Models;

namespace Gridify.WebAPI.GridifyMappers;

public class PersonGridifyMapper : GridifyMapper<Person>
{
    public PersonGridifyMapper()
    {
        // Define your mappings here
             RemoveMap(nameof(Person.Password))
	        .AddMap("id", p => p.Id)
	        .AddMap("address", p => p.Contact.Address)
	        .AddMap("mobile", p => p.Contact.PhoneNumber)
	        .AddMap("userName", p => p.UserName, v => v.ToLower());

        // optionally you can customize the configuration for each mapper
        Configuration.CaseSensitive = false;
        Configuration.AllowNullSearch = true;
        Configuration.IgnoreNotMappedFields = true;
    }
}
